import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    /*默认定位到住户列表中*/
    redirect:'/resident',
    //子级页面
    children:[
      {path:'/bill',component: () => import( '../views/bill/Bill.vue')},
      {path:'/resident',component: () => import( '../views/resident/Resident.vue')}
    ]

  },
    //登录页
  {path:'/login',component: () => import( '../views/Login.vue')}
]



const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
